<?php       
    //$hinhanhs = $viewModel->get('hinhanhs'); 
    $baiviets = $viewModel->get('baiviets'); 
    $category = $viewModel->get('category'); 
    $cothemuonxems = $viewModel->get('cothemuonxems'); 
 ?>


        <section class="main_content">
        <div class="container">
            <div class="row">
                <p class="sitemap">
					<a href="<?php echo BASE_URL; ?>">Trang chủ</a> <span class="glyphicon glyphicon-play"></span>
				    <?php echo $category->TenDanhMuc ?>                  
				</p>
                <div class="col-md-8">
                    <?php foreach ($baiviets as $baiviet) {?> 
                            <div class="media">
                                <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$baiviet->DuongDan ?>">
                                    <img class="media-object" height="120px" width="150px" src="<?php if(!empty($baiviet->AnhThumb)){echo $baiviet->AnhThumb;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>" alt="...">
                                </a>
                                <div class="media-body">                                
                                    
                                    <h4 class="category_item_title"><?php echo $baiviet ->TieuDe ?></h4>

                                    <?php 
                                        if (strlen($baiviet ->MoTa)<380)
                                        {
                                            echo $baiviet ->MoTa;
                                        }
                                        else
                                        {
                                            echo substr($baiviet ->MoTa, 0, 380).'...';
                                        }
                                    ?>
                                    <br>
                                    <a class="read-more btn btn-info" href="<?php echo BASE_URL.'baiviet/detail/'.$baiviet->DuongDan ?>">Xem chi tiết <span class="glyphicon glyphicon-circle-arrow-right"></span></a>
                                </div>
                            </div>                      
                            <?php }?>
                </div>
                <div class="col-md-4">
                    <div class="panel panel-info">
                        <div class="panel-heading">Có thể bạn muốn xem</div>
                        <div class="panel-body">
                                    <ul>
                                    <?php foreach ($cothemuonxems as $cothemuonxem) { ?>                                    
                                      <li class="media bt-top">
                                        <a class="pull-left" href="#">
                                          <img src="<?php if(!empty($cothemuonxem->AnhThumb)){echo $cothemuonxem->AnhThumb;}else{echo PATH_IMAGE.'bai-viet.png';}  ?>" height="70px" width="70px" title="<?php echo $cothemuonxem->TieuDe ?>" alt="<?php echo $cothemuonxem->TieuDe ?>" class="img-responsive news-img img-thumbnail">
                                        </a>
                                        <div class="media-body">                  
                                            <h4 class="media-heading">
                                              <a class="pull-left" href="<?php echo BASE_URL.'baiviet/detail/'.$cothemuonxem->DuongDan; ?>">
                                                
                                                  <?php 
                                                    if (strlen($cothemuonxem->TieuDe)<35)
                                                    {
                                                      echo $cothemuonxem->TieuDe;
                                                    }
                                                    else
                                                    {
                                                      echo substr($cothemuonxem->TieuDe, 0, 35).'...';
                                                    }
                                                 ?>
                                              </a>
                                            </h4>
                                             <br>
                                             <p class="info_small">
                                                  <?php 
                                                    if (strlen($cothemuonxem->MoTa)<100)
                                                    {
                                                      echo $cothemuonxem->MoTa;
                                                    }
                                                    else
                                                    {
                                                      echo substr($cothemuonxem->MoTa, 0, 100).'...';
                                                    }
                                                 ?>
                                             </p>
                                        </div>
                                      </li>
                                    <?php } ?> 
                                </ul>
                                     
                        </div>
                    </div>
                    <a href="#"><img width="100%" src="<?php echo PATH_IMAGE.'banner/banner-du-lich-thai-lan.png' ?>" class="img-responsive"></a>
                </div>

            </div> 
            <?php //include 'footer.php'; ?>
        </div>
        </section>
   